package com.xigua.a01;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2022/3/2721:03
 */
@Component
public class Component1 {
    private static final Logger logger = LoggerFactory.getLogger(Component2.class);

    @Autowired
    private ApplicationEventPublisher context;

    public void register(){
        logger.debug("用户注册");
        context.publishEvent(new UserRegisteredEvent(this));
    }

}
